﻿/*----------------------------------------------------------------
  //Copyright (C) 2012 赵国伟
  //文件功能描述：商品管理
  //创建人：赵国伟
  //生成时间：2012/03/17 16:15:00
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Shopping.Common;
using Shopping.Model;
using Shopping.BLL;

public partial class Manage_GoodsManage : BaseManagePage
{
    protected string SelectOptionOfCategory; //产品类别选项；
    protected string SelectOptionOfBrand; //商品品牌选项；
    protected string SelectOptionOfPackUnit; //产品包装选项；
    protected string SelectOptionOfGoodsUnit; //商品单位选项；
    protected string SelectOptionOfSaleStatus; //商品销售状态选项；
    protected string SelectOptionOfPlace; //商品产地选项；
    protected string SelectOptionOfSpecialArea; //商品所属专区；
    protected string CheckOptionOfCommend; //商品推荐选项；

    protected QueryGoodsAsPage p; //商品查询对象；

    protected List<GoodsInfo> listOfGoods; //商品列表信息；

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            InitPageInfo();
        }
    }

    #region "初始化页面基本信息；"
    /// <summary>
    /// 初始化页面基本信息；
    /// </summary>
    private void InitPageInfo()
    {
        p = new QueryGoodsAsPage(true);
       
        SelectOptionOfCategory = CategoriesManage.GetEndNodeCategoriesToSelectOption(false, p.TCategoryID.ToString());
        SelectOptionOfBrand = BrandsManage.GetBrandsByCategoryIdToSelectOption(p.TCategoryID, true, p.BrandID.ToString());
        SelectOptionOfPackUnit = DictionariesManage.GetDictionariesToddlObject(DictionaryCategory.包装类型, true,"");
        SelectOptionOfGoodsUnit = DictionariesManage.GetDictionariesToddlObject(DictionaryCategory.商品单位, true, "");
        SelectOptionOfPlace = GoodsPlacesManage.QueryPlacesToSelectOption(true, p.GoodsPlaceID.ToString());
        SelectOptionOfSpecialArea = DictionariesManage.GetDictionariesToddlObject(DictionaryCategory.专区, true, "");
        SelectOptionOfSaleStatus = Utility.GetEnumToSelectOption<GoodsSaleStatus>(p.SaleStatus);
        CheckOptionOfCommend = DictionariesManage.GetDictionariesToCheckOption(DictionaryCategory.商品推荐类别, "chkCommend", "", 4);
        GoodsManage bllGoods = new GoodsManage();
        listOfGoods = bllGoods.QueryListAsPage(p);
    }
    #endregion


}